Skip to content

Model:Cycles base 7b0c96d9: the machine table and machine switches - #2479

Draft
durchgemacht wants to merge 8 commits into
repeat98:base/model-cycles-nextfrom
durchgemacht:base/model-cycles-machine-table-core
Draft

durchgemacht wants to merge 8 commits into
repeat98:base/model-cycles-nextfrom
durchgemacht:base/model-cycles-machine-table-core

Conversation

@durchgemacht

@durchgemacht durchgemacht commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

The machine table and machine switches for the Model:Cycles base, on Modwerk's own core (#2394) and the held sites of base/model-cycles-next, with the record format agreed with the owner on 30 November 2026.

  • What works: the base owns two tables. mw_machines (events.json index 6) gives machine modules eight slots, 6 to 13, after the six stock machines: a module contributes one record from its runtime package (name, picture, its four knobs' names and defaults, Amp Decay's default, update and render), and its machine shows up after CHORD, plays on its tracks, and reads "----" and stays silent when the module is taken out; the sound keeps its machine and plays again once the module is back. mw_machine_switches (index 7) lets a machine take PUNCH and GATE as switches: MACHINES held + PUNCH or GATE on a track that plays it flips the machine's switch instead of the stock parameter, the LEDs show the switches while MACHINES is held, and the list opens on the release if no switch was flipped. The switches live in k 32 and are saved with the sound. As agreed, the record already reserves four params for a machine's own parameters (k 23 to 26 in the next step), so there is one record format; the base does not read them yet. include/mc/sound.h names the words the base adds to a sound and k 32's fields (Track FX 0-7, PUNCH 8, GATE 9, the Track FX values' destinations 10-15), with _Static_asserts that keep them apart and every bit owned; 0 is "as stock" everywhere. Release base 7b0c96d9: 94 bytes .boot, 47,540 .run, 125,060 .bss, 126 sites. This also brings base/model-cycles-next's binding up to date: it still names dda53ffd, while that branch builds as 550da07a since the held-sites commits; with this change the branch builds as 7b0c96d9, which the binding now records.
  • What is broken: with this change alone, a project with a track on an added machine freezes stock 1.13 when MACHINES opens; the fix is its own commit in the next pull request, and both go out together through base/model-cycles-next. The record's params are not read yet; that is the next pull request.
  • What it means musically: nothing yet without a machine module. With one, a new machine after CHORD, and PUNCH and GATE as its own switches. The first planned is MAXSAW.
  • Ran on a unit: yes, my own Model:Cycles, both release builds flashed with Transfer: 23a7a53a (before the merge of base/model-cycles-next) through the whole list below, then 7b0c96d9 (after it; the same identity again after Improvement: Modwerk's own core for the Model:Cycles base #2394 reached base/model-cycles-next) for the identity, a kept trial and a saved project with a switch on. Recovery over MIDI IN after the base is not tested: neither of us has a MIDI interface (owner, 30 November 2026).
  • Who must act: the owner reviews.
  • Next: the parameters per track on k 23 to 32 (four for the machine, four for the Track FX), with SAMPLE and Model-TG through the base and descriptors 10 to 13 without a CC; then a kept module restored after a power cycle.

Tested on a unit: release base 7b0c96d9, image b21e259f flashed with Transfer: ident set CRC 0xad8b9c8d, 47604 bytes; sine.mwrm refused at keep while playing, kept when stopped; a project saved with a switch on plays SINE on C4 for 30 s and more. Release base 23a7a53a, image 3c01d911 flashed: ident 0x7946f5e6, 46576 bytes; SINE on trial after CHORD with TONE's picture, a tone on C5; MACHINES + PUNCH flips its switch (C4) and lights PUNCH, the list opens on the second release only; the switch saved and loaded with the project; PUNCH alone toggles stock PUNCH on SINE and KICK; MACHINES on KICK opens on the press; a held trig shows NOTE, VEL and LEN on SINE and TONE; removed while playing refused, removed when stopped silent and "----", tried again plays on C4 without choosing it again.

Edge cases

Case Why this change makes it a risk How run Result
Boot and identity the base owns 126 sites now 7b0c96d9 and 23a7a53a flashed with Transfer, mc_link.py ident pass: 0xad8b9c8d / 47,604 and 0x7946f5e6 / 46,576 bytes, armed 0
A machine on trial the table hands the voice loop a module's update and render try sine.mwrm --keep, track 1 on SINE, PITCH 64, DECAY 60, one trig on step 1 pass: SINE after CHORD with TONE's picture, a tone on C5
MACHINES + PUNCH the base takes PUNCH's press, its LED and MACHINES' release MACHINES held, PUNCH, let go; then MACHINES alone pass: the tone an octave lower, PUNCH lit while MACHINES is held; the list opens at the second release only
The switch saved k 32 goes to record slot 18 and back the switch on, the project saved, another loaded, this one again pass: still C4, PUNCH lit while MACHINES is held
PUNCH alone stock's PUNCH must stay stock's PUNCH alone on SINE and on KICK pass: the LED toggles on both; SINE keeps its own envelope, so PUNCH is not heard on it
MACHINES on a stock machine only a track with switches waits for the release MACHINES on KICK pass: the list opens on the press
A held trig the trig page must not see the added machine differently a held trig on the main page, track 1 on SINE and on TONE pass: NOTE, VEL and LEN on both (with the MACHINES list open a held trig locks a machine, as stock)
Removal while playing nothing switches while a pattern plays remove sine with PLAY on pass: unsafe (playing?)
Removal and return an empty slot must stay silent and keep the sound's machine stopped, remove sine --keep, PLAY; stopped, try sine.mwrm --keep, PLAY pass: silent and "----"; then SINE on C4 again without choosing it, the switch kept
Keep at the end of a trial while playing the trial must not be kept while unsafe PLAY during the 10 s trial on 7b0c96d9 pass: refused at the end, unsafe (playing?)
The held sites merged in runtime.c changed under the table 7b0c96d9 flashed, a kept trial, the saved project pass: SINE kept (generation 3), C4 for 30 s and more
Recovery with the stock .syx over MIDI IN a base must never block the way back not run not run: no MIDI interface here; Transfer brings stock back as before (#2394's record)
A power cycle with a kept module modules live in RAM only not run not run: the restore after a power cycle is the next step
GATE as a switch, two machine modules the same code paths as PUNCH and one module not run not run: SINE takes PUNCH only

Guides: the Model:Cycles README and the machines guide did not say what a machine record must carry for parameters to come, or which bits of k 32 are taken; both say it now, and include/mc/sound.h holds the layout. One finding outside this change, not fixed here: octatrack-base.test.ts builds its folder with new URL(…).pathname, so it fails in a checkout whose path has a space (%20); it belongs in its own Fix: pull request. Locally pr:ready -- --base-branch base/model-cycles-next passed everything else (zoom-link and machine-slots timed out under load and pass alone).

🤖 Generated with Claude Code

durchgemacht and others added 8 commits November 30, 2026 14:25
The base owns mw_machines (events.json index 6): eight machine slots, 6 to
13, after the six stock machines. A machine module contributes one struct
mw_machine (include/mc/machine.h) from its runtime package and claims its
slot as machine:<slot>. A slot whose module is gone reads "----" and stays
silent, and plays again once the module is back; without a machine module
every stock flow is as it was.

mw_machine_switches (index 7) lets a machine take PUNCH and GATE as
switches: MACHINES held + PUNCH or GATE on a track that plays it flips the
switch instead of the stock parameter, the LEDs show the switches while
MACHINES is held, and the list opens on the release if no switch was
flipped. The switches live in k 32 and are saved with the sound.

The record reserves four params for a machine's own parameters (k 23-26 in
a later base), so there is one record format; the base does not read them
yet. include/mc/sound.h names the words the base adds to a sound and k 32's
fields, kept apart by _Static_assert; 0 is "as stock" everywhere.

Release base 23a7a53a (94 .boot, 46512 .run, 125060 .bss, 126 sites),
flashed on a unit: SINE on trial plays, its switch, saved and loaded,
removal and return as recorded in docs/verification.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With main and base/model-cycles-next merged (a runtime module never patches
over the base's own sites), the release base is 7b0c96d9: 94 .boot, 47540
.run, 125060 .bss, 126 sites. Flashed on a unit: set CRC 0xad8b9c8d, SINE
kept and played with its switch from a saved project.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
repeat98#2394) into base/model-cycles-machine-table-core

The Model:Cycles sources are unchanged by the merge: the base still builds as 7b0c96d9 (94 bytes .boot, 47,540
.run, 125,060 .bss, 126 sites), matching base-binding.json.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this reads well and the record is thorough.

Where it stands: I read the machine table and the switches (machines.c, switches.c, machine.h, sound.h) and found nothing to change. An empty slot stays silent and reads "----", stock flows are untouched without a machine module, and the switches only take PUNCH and GATE while MACHINES is held on a track whose machine asks for them. Your unit record covers both release builds, and the untested cases (recovery over MIDI IN, a power cycle with a kept module, GATE and two machine modules) are named as such.

Next step: when you're done with it, mark it ready (gh pr ready 2479). Pull requests into base/model-cycles-next only run the description check, so nothing else needs to go green. As base work, it then waits for the owner's approval before it merges into the cumulative branch.

The octatrack-base.test.ts path-with-a-space finding you mention would be welcome as its own small Fix: pull request against main.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant